<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // concar()
        // 合并数组或元素，返回新的数组，原数组不会改变
        let arr1=['妲己','钟馗','吕布','卤蛋','李白'];
        let arr2=['程咬金','白起','蔡文姬'];
        let arr3=['梦魇','制裁'];
        // 1.参数是一个或者多个数据
        let result1=arr1.concat(arr2);
        let result =arr1.concat(arr2,arr3);
        console.log(result1);
        console.log(result);

        // 2.原函数不受影响
        console.log(arr1,arr2,arr3);

        // 3.参数是元素
        let result2=arr1.concat('貂蝉');
        console.log(result2);
    </script>
</body>
</html>